{include file="public/head"/} 
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>后台管理</cite></a>
        <a><cite>停车场地管理中心</cite></a>
        <a><cite>免费放行账单</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="{url(admin/Order/orderList)}">
          <div class="layui-input-inline">
            <select name="out_parking_id" lay-filter="commname" id="commname">
              <option value="">所属停车场</option>
              {foreach $parkinglist as $parking}
              <option value="{$parking.out_parking_id}" {if isset($out_parking_id)}{if $out_parking_id == $parking.out_parking_id} selected {/if}{/if}>{$parking.parking_name}</option>
              {/foreach}
            </select>
          </div>
		  <input type="text" name="pay_money"  placeholder="订单金额" autocomplete="off" class="layui-input" value="{if isset($pay_money)}{$pay_money}{/if}">
          <input type="text" name="order_no"  placeholder="订单号" autocomplete="off" class="layui-input" value="{if isset($where.order_no)}{$where.order_no}{/if}">
          <input type="text" name="car_number"  placeholder="车牌号码" autocomplete="off" class="layui-input" value="{if isset($car_number)}{$car_number}{/if}">
		  <input type="text" name="parkingspace"  placeholder="车位号" autocomplete="off" class="layui-input" value="{if isset($parkingspace)}{$parkingspace}{/if}">
          <!--<div class="layui-input-inline">
            <select name="pay_type">
				<option value="">付款方式</option>
				<option value="1" {if isset($where.pay_type)}{if $where.pay_type == '1'}selected{/if}{/if}>支付宝代扣</option>
				<option value="2" {if isset($where.pay_type)}{if $where.pay_type == '2'}selected{/if}{/if}>支付宝扫码</option>
				<option value="3" {if isset($where.pay_type)}{if $where.pay_type == '3'}selected{/if}{/if}>支付宝预交费</option>
				<option value="4" {if isset($where.pay_type)}{if $where.pay_type == '4'}selected{/if}{/if}>微信代扣</option>
				<option value="5" {if isset($where.pay_type)}{if $where.pay_type == '5'}selected{/if}{/if}>微信预交费</option>
				<option value="6" {if isset($where.pay_type)}{if $where.pay_type == '6'}selected{/if}{/if}>微信扫码</option>
				<option value="7" {if isset($where.pay_type)}{if $where.pay_type == '7'}selected{/if}{/if}>现金</option>
				<option value="8" {if isset($where.pay_type)}{if $where.pay_type == '8'}selected{/if}{/if}>固定优惠券</option>
				<option value="9" {if isset($where.pay_type)}{if $where.pay_type == '9'}selected{/if}{/if}>停车优惠券</option>
				<option value="10" {if isset($where.pay_type)}{if $where.pay_type == '10'}selected{/if}{/if}>优惠券</option>
				<option value="11" {if isset($where.pay_type)}{if $where.pay_type == '11'}selected{/if}{/if}>刷码支付</option>
				<option value="12" {if isset($where.pay_type)}{if $where.pay_type == '12'}selected{/if}{/if}>0费用</option>
				<option value="13" {if isset($where.pay_type)}{if $where.pay_type == '13'}selected{/if}{/if}>业主福利车</option>
				<option value="14" {if isset($where.pay_type)}{if $where.pay_type == '14'}selected{/if}{/if}>免费放行</option>
            </select>
          </div>     -->     
          <!--<div class="layui-input-inline">
             <select name="order_status">
              <option value="">账单状态</option>
              <option value="1" {if isset($where.order_status)}{if $where.order_status == '1'}selected{/if}{/if}>未付款</option>
              <option value="TRADE_SUCCESS" {if isset($where.order_status)}{if $where.order_status == 'TRADE_SUCCESS'}selected{/if}{/if}>已付款</option>
            </select>
          </div>-->
		  <div class="layui-input-inline">
             <select name="order_type">
              <option value="">订单类型</option>
              <option value="2" {if isset($where.order_type)}{if $where.order_type == '2'}selected{/if}{/if}>一位多车</option>
              
            </select>
          </div>
		  <input type="text" class="layui-input" id="test5" name="start_time" placeholder="开始时间" {if isset($start_time)}value="{$start_time}"{/if}>
          <input type="text" class="layui-input" id="test6" name="end_time" placeholder="结束时间" {if isset($end_time)}value="{$end_time}"{/if}>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
          <!-- <button type="reset" class="layui-btn"><i class="layui-icon">&#xe639;</i></button> -->
        </form>
      </div>
      <xblock>
	  <button class="layui-btn" onclick="orderDump('{$export}')"><i class="layui-icon"></i>批量导出</button>
        <!-- <button class="layui-btn" onclick="x_admin_show('添加停车场','{:url('admin/Parking/parkingAdd')}',700,680)"><i class="layui-icon"></i>添加停车场</button> -->
       
		<span class="x-right" style="line-height:40px">金额：{$summoney}元，共有数据：{$number} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <!-- <th style="text-align: center; font-size: 16px;">
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th> 
            -->
            
			<th style="text-align: center; font-size: 16px; height: 30px;">ID</th>
            <th style="text-align: center; font-size: 16px;">停车场名称</th>
			<th style="text-align: center; font-size: 16px;">入口</th>
            <!--<th style="text-align: center; font-size: 16px;">支付宝停车场ID</th>-->
            <th style="text-align: center; font-size: 16px;">车牌号码</th>
            <th style="text-align: center; font-size: 16px;">系统订单号</th>
            <th style="text-align: center; font-size: 16px;">订单状态</th>
            <!--<th style="text-align: center; font-size: 16px;">订单创建时间</th>
            <th style="text-align: center; font-size: 16px;">支付宝订单号</th>-->
            <th style="text-align: center; font-size: 16px;">缴费时间</th>
           
            <th style="text-align: center; font-size: 16px;">应收费用</th>
			<th style="text-align: center; font-size: 16px;">实收金额</th>
			<th style="text-align: center; font-size: 16px;">优惠金额</th>
            <th style="text-align: center; font-size: 16px;">入场时间</th>
            <th style="text-align: center; font-size: 16px;">出场时间</th>
            <th style="text-align: center; font-size: 16px;">停车时长</th>
			
			{if $usertype == 0}
            <th style="text-align: center; font-size: 16px;">操作</th>
            {/if}
            <!-- <th style="text-align: center; font-size: 16px;">状态</th> -->
          </tr>
        </thead>
        <tbody>
          {foreach $list as $lis}
          <tr>
            <!-- <td style="text-align: center;">
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>
           -->
			<td style="text-align: center;">{$lis.id}</td>
            <td style="text-align: center;">{$lis.parking_name}</td>
			<td style="text-align: center;">{$lis.in_system_name}</td>
            <!--<td style="text-align: center;">{$lis.parking_id}</td>-->
            <td style="text-align: center;">{$lis.car_number}</td>
            <td style="text-align: center;">{$lis.out_order_no}</td>
            <td style="text-align: center;">
              {if $lis.order_status == 'TRADE_SUCCESS'}
                已付款
              {elseif $lis.order_status == 0}
                停车中
              {/if}
            </td>
            <!--<td style="text-align: center;">{$lis.order_time}</td>
            <td style="text-align: center;">{$lis.order_no}</td>-->
            <td style="text-align: center;">{if $lis.pay_time!= 0}{$lis.pay_time|date="Y-m-d H:i:s",###}{/if}</td>
            
            <td style="text-align: center;">{$lis.pay_money}元</td>
			<td style="text-align: center;">{$lis.receipt_amount}元</td>
			<td style="text-align: center;">{$lis.discount_money}元</td>
            <td style="text-align: center;">{$lis.in_time|date="Y-m-d H:i:s",###}</td>
            <td style="text-align: center;">{if $lis.out_time!= 0}{$lis.out_time|date="Y-m-d H:i:s",###}{/if}</td>
            <td style="text-align: center;">
              
                {$lis.in_duration}
              
			</td>
			
			{if $usertype == 0}
            <td class="td-manage" style="text-align: center;">
              <a title="删除" onclick="orderDel('{$lis.id}', '{$lis.id}')" href="javascript:;" id="{$lis.id}">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
            {/if}
           
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div>
            {$orderlist->render()}
        </div>
      </div>

    </div>
    <script>
		layui.use('laydate', function() {
            var laydate = layui.laydate;
            //日期时间选择器
            laydate.render({
                elem: '#test5'
                ,type: 'datetime'
            });
            //日期时间选择器
            laydate.render({
                elem: '#test6'
                ,type: 'datetime'
            });
        });
      //删除
      function orderDel(id, doc){
        if(confirm('确定要删除吗?')) 
        { 
          var url = "{:url('orderDel')}?id=" + id
          // console.log(url)
          $('#' + doc).attr('href', url)
        } 
          return false; 
      } 
      
	  //批量导出
      function orderDump(exportid){
          var url = "{:url('orderExcel')}?&export=" + exportid;
          layer.open({
              type: 2,
              title: '批量导出账单',
              shadeClose: true,
              shade: 0.8,
              area: ['60%', '60%'],
              content: url //iframe的url
          });
      }

    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  </body>

</html>